package string;

public class ToUpperCaseDemo {
    public static void main(String[] args) {
        String str = " 我爱Java";
        int length = str.length();
        System.out.println(length);
        str = str.trim();
        System.out.println(str);
        boolean b = str.startsWith(" 我爱");
        System.out.println(b);
        boolean a = str.endsWith("a");
        System.out.println(a);
        int a1 = str.indexOf("a");
        System.out.println(a1);
        int a2 = str.lastIndexOf("a");
        System.out.println(a2);
        String substring = str.substring(2);
        System.out.println(substring);
        String substring1 = str.substring(0, 2);
        System.out.println(substring1);
        String s = str.toUpperCase();
        System.out.println(s);
        s = s.toLowerCase();
        System.out.println(s);
    }
}
